<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <title>建议反馈 - 食物食材食品基本信息Web系统</title>
  <link rel="stylesheet" href="css/style.css">
  <script>
    if (!sessionStorage.getItem('isLoggedIn')) {
      window.location.href = 'login.html';
    }
  </script>
</head>
<body>
  <div class="bg"></div>
  <div class="bg bg2"></div>
  <div class="bg bg3"></div>
  <header>
    <h1>食物食材食品基本信息Web系统</h1>
    <nav>
      <div class="user-menu" id="userMenu">
        <img src="img/avatar.png" alt="头像" class="avatar" id="userAvatar">
        <span class="username" id="usernameDisplay">用户</span>
        <span class="dropdown-arrow">&#9662;</span>
        <div class="dropdown-menu" id="dropdownMenu">
          <a href="#" id="profileLink"><span class="menu-icon">&#8962;</span> 个人空间</a>
          <a href="login.html" id="logout"><span class="menu-icon">&#9906;</span> 退出登录</a>
        </div>
      </div>
    </nav>
  </header>
  <main>
    <a href="index.html" class="back-home-btn"><span>返回首页</span></a>
    <section>
      <h2>建议反馈</h2>
      <p class="suggestion-intro">欢迎您对系统功能和数据结构提出宝贵建议，我们将认真考虑每一条建议！</p>
      
      <!-- 提交建议 -->
      <div class="suggestion-section">
        <h3>提交新建议</h3>
        <form id="suggestionForm" class="suggestion-form">
          <div class="form-row">
            <div class="form-group">
              <label for="suggestionType">建议类型：</label>
              <select id="suggestionType" name="suggestionType" required>
                <option value="">请选择建议类型</option>
                <option value="功能改进">功能改进</option>
                <option value="数据结构">数据结构</option>
                <option value="界面优化">界面优化</option>
                <option value="性能优化">性能优化</option>
                <option value="其他建议">其他建议</option>
              </select>
            </div>
            <div class="form-group">
              <label for="priority">建议紧急程度：</label>
              <select id="priority" name="priority" required>
                <option value="">请选择</option>
                <option value="很紧急">很紧急</option>
                <option value="一般">一般</option>
                <option value="不紧急">不紧急</option>
              </select>
            </div>
          </div>
          <div class="form-group">
            <label for="suggestionTitle">建议标题：</label>
            <input type="text" id="suggestionTitle" name="suggestionTitle" placeholder="请简要描述您的建议" required>
          </div>
          <div class="form-group">
            <label for="suggestionContent">详细描述：</label>
            <textarea id="suggestionContent" name="suggestionContent" rows="6" placeholder="请详细描述您的建议，包括现状、改进方案、预期效果等" required></textarea>
          </div>
          <div class="form-group">
            <label for="contactInfo">联系方式（可选）：</label>
            <input type="text" id="contactInfo" name="contactInfo" placeholder="邮箱或电话，方便我们与您联系">
          </div>
          <div class="form-actions">
            <button type="submit" class="btn btn-primary">提交建议</button>
            <button type="button" class="btn btn-secondary" id="resetSuggestionBtn">重置表单</button>
          </div>
        </form>
      </div>
      
      <!-- 建议列表 -->
      <div class="suggestion-section">
        <h3>建议列表</h3>
        <div class="filter-controls">
          <div class="form-row">
            <div class="form-group">
              <label for="filterType">类型筛选：</label>
              <select id="filterType" name="filterType">
                <option value="">全部类型</option>
                <option value="功能改进">功能改进</option>
                <option value="数据结构">数据结构</option>
                <option value="界面优化">界面优化</option>
                <option value="性能优化">性能优化</option>
                <option value="其他建议">其他建议</option>
              </select>
            </div>
            <div class="form-group">
              <label for="filterStatus">状态筛选：</label>
              <select id="filterStatus" name="filterStatus">
                <option value="">全部状态</option>
                <option value="待处理">待处理</option>
                <option value="审核中">审核中</option>
                <option value="已采纳">已采纳</option>
                <option value="已拒绝">已拒绝</option>
              </select>
            </div>
          </div>
        </div>
        <div id="suggestionsList">
          <!-- 建议列表将在这里显示 -->
        </div>
      </div>
      
      <!-- 成功提示 -->
      <div id="successMessage" style="display: none;">
        <div class="success-alert">
          <h3>建议提交成功！</h3>
          <p>感谢您的宝贵建议，我们会认真考虑并及时反馈。</p>
          <button class="btn btn-primary" onclick="location.reload()">继续提交</button>
        </div>
      </div>
    </section>
  </main>
  <footer>
    <p>&copy; 2025 食物食材食品基本信息Web系统</p>
  </footer>
  <script src="js/suggestion.js"></script>
  <script src="js/user_menu.js"></script>
</body>
</html> 